<% layout('/layout/default.html', {title: '流程表单信息', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="card-header">
		<i class="fa fa-sitemap"></i> 流程表单信息
		<div class="header-tools float-right">
			<a href="#" class="btn btn-default btn-sm" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
		</div>
	</div>
	<div class="container-fluid">
		<form id="searchForm" action="${ctx}/act/flowForm/listData" class="form-inline d-none">
			<div class="form-group">
				<button type="submit" class="btn btn-success btn-sm ">查询</button>
				<button id="reset" type="reset" class="btn btn-default btn-sm">重置</button>
			</div>
		</form>
		<table id="dataGrid"></table>
	</div>
</div>
<% } %>
<script>
	$('#dataGrid').dataGrid({
		searchForm: $("#searchForm"),
		columnModel: [
			{header:'模型名称', name:'modelName', index:'d.name', width:90, align:"center"},
			{header:'模型key', name:'modelKey', index:'a.model_key', width:90, align:"center"},
			{header:'流程模型版本', name:'modelVersion',index:'a.model_version',width:90, align:"center"},
			{header:'更新时间', name:'updateDate', index:'a.update_date', width:90, align:"center"},
			{header:'操作', name:'actions', width:100, sortable:false, title:false, align:"center",formatter: function(val, obj, row, act){
					var actions = [];
					actions.push('<a href="${ctx}/act/flowForm/preview?id='+row.id+'" class="btnList" title="表单预览" data-type="diagram"><i class="fa fa-desktop"></i></a>&nbsp;&nbsp;');
				<% if(hasPermi('flowable:flowForm:edit')){ %>
						actions.push('<a href="/act/flowForm/userPermission?id='+row.id+'" class="btnList" title="人员权限关联"><i class="fas fa-user-cog"></i></a>&nbsp;&nbsp;');
						actions.push('<a href="${ctx}/act/flowForm/copy?id='+row.id+'" class="btnList" title="复制增加版本信息" data-confirm="确认要对该流程表单复制以及增加版本吗？"><i class="far fa-clone"></i></a>&nbsp;&nbsp;');
						actions.push('<a href="${ctx}/act/flowForm/delete?id='+row.id+'" class="btnList" title="删除流程表单信息" data-confirm="确认要删除该流程表单信息吗？"><i class="far fa-trash-alt"></i></a>&nbsp;&nbsp;');
					<% } %>

					return actions.join('');
				}}
		],
		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});
</script>